document.write('<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=F6eTaN7pws2E23tdZL5BHPQeRWBXyLbW"></script>');
// $.ajax({type:'get',url:"http://api.map.baidu.com/api?v=2.0&ak=F6eTaN7pws2E23tdZL5BHPQeRWBXyLbW",async:false,dataType:'script'});
var current_city = "北京";
var street_info = "北京市";
var lng = "116.331398";
var lat = "39.897445";
var flag = false;
var geoc = new BMap.Geocoder();
var geolocation = new BMap.Geolocation();
geolocation.getCurrentPosition(function(r) {
	if (this.getStatus() == BMAP_STATUS_SUCCESS) {
		var mk = new BMap.Marker(r.point);
		geoc.getLocation(r.point, function(rs) {
			var addComp = rs.addressComponents;
			current_city = addComp.city;
			street_info = addComp.district + addComp.street + addComp.streetNumber;
			lng = r.point.lng;
			lat = r.point.lat;
			flag = true;
		});
	} else {
		alert('failed' + this.getStatus());
	}
}, {
	enableHighAccuracy : true
});

function getCurrentCityInfo() {
	var info = "";
	if (flag == true) {
		info += lng + "," + lat + "," + current_city + "," + street_info;
		return info;
	} else {
		return "没有数据";
	}
}